home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 36 / dvqmlfix.zip / ECHO_R.ZIP / ECHO_R.ASM next >
Assembly Source File  |  1986-11-21  |  3KB  |  64 lines

  1. ;
  2. ; ECHO_R: A remote ECHO for DOORS users.
  3. ;
  4. ; Courtesy of: The BBS of Excellence (312)398-2872
  5. ;
  6. ; To make this program work under COM2: change the constants as
  7. ; indicated. ANSI can be displayed by using "@" in place of esc.
  8. ;
  9. cseg    segment  byte public 'CODE'
  10.         assume   cs:cseg,ds:cseg,es:cseg
  11.         org      100h
  12. ECHO_R  proc     near
  13.         jmp      MainCode   ; Skip over constant
  14. ;
  15. DataReg  dw      3F8h       ; for COM1: 2F8h = COM2:
  16. LineReg  dw      3FDh       ; for COM1: 2FDh = COM2:
  17. ;
  18. MainCode:
  19.         Call     WriteMsg   ; If a message exists, then output it
  20.         Int      20h        ; Terminate program
  21. ECHO_R  endp
  22.  
  23. WriteMsg   Proc    Near
  24.            mov     SI,80h          ; point to the command buffer
  25.            Xor     CX,CX           ; Init the loop counter
  26.            Mov     CL,[SI]         ; Get the input length
  27.            Cmp     CL,0            ; Was there no input ?
  28.            JZ      ExitWrite       ; True...then exit
  29.            Inc     SI              ; Point past the length
  30. WriteLoop:
  31.            Mov     AH,2            ; Indicate screen write
  32.            Inc     SI              ; Point to next character
  33.            Mov     DL,[SI]         ; Get the character
  34.            Cmp     DL,'@'          ; Is this an Esc character ?
  35.            Jne     WriteScreen     ; No...continue
  36.            Mov     DL,27           ; Change to a REAL Esc character
  37. WriteScreen:
  38.            Int     21h             ; Write character to the screen
  39.            Mov     AL,[SI]         ; Get the character
  40.            Cmp     AL,'|'          ; Is it an Esc request ?
  41.            Jne     WriteCom        ; No...continue
  42.            Mov     AL,27           ; Change to a REAL Esc character
  43. WriteCom:
  44.            Push    AX              ; Save the byte
  45. WaitLineLoop:
  46.            Mov     DX,LineReg      ; Get the Line Register address xFDh
  47.            In      AL,DX           ; Get the Line status
  48.            And     AL,20h          ; Is the Xmit buffer empty ?
  49.            Cmp     AL,20h          ; Is it?
  50.            Jne     WaitLineLoop    ; No...Exit to caller
  51.            Pop     AX              ; Restore the byte
  52.            Mov     DX,DataReg      ; Point to output port
  53.            Out     DX,AL           ; Output the character
  54.            Loop    WriteLoop       ; Keep doing it until no more
  55. ExitWrite:
  56.            Ret                     ; Return to main routine
  57. WriteMsg   Endp
  58.  
  59. Wait       Endp
  60. CSEG       Ends
  61.            End     ECHO_R
  62.  
  63.  
  64.